<?php
require 'TVB/pms/pdes/common/bootstrap.php';

function checkSignature(){
	if(empty($_REQUEST['image_id'])) {
		http_send_status(405);
		exit();
	}
	return true;
	//http_send_status(405);
}

checkSignature();

/*
$callback_api = $api + image_id = $image_id
array (
  'source_id' => '1196',
  'export_id' => '2567',
  'destination_id' => '1',
  'status' => '1',
  'signature' => '3bc9affa346b25fe4aabcc7b50500b41e94b3e44',
  'http_path' => 'http://img.tvb.com/ii/2/26/000000002567_1244708111.jpg',
)
*/ 

$image_id  = $_REQUEST['image_id'];
$image_obj = Model::$dbo['w']->findInstance('image',$image_id);
$image_obj->source_url = $_REQUEST['http_path'];
$image_obj->ii_status  = AC::IMAGE_STATUS_UPLOADED;

Model::$dbo['w']->save($image_obj);

